package com.cxm.qyyz.entity.event;

import androidx.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class HomeEvent {

    @Retention(RetentionPolicy.SOURCE)
    @IntDef({State.SERVICE_DISABLE,State.REQUEST_ERROR,State.ALREADY_POP,State.CANCEL_POP,State.FUNCTION_CLOSE,
            State.HOME_AUTO_DIALOG_LIST_END,State.LINKAGE_INTERRUPT_REFRESH_DATA})
    public @interface State {
        /** 后台服务禁用该功能*/
        int SERVICE_DISABLE = 0;
        /** 请求失败*/
        int REQUEST_ERROR = 1;
        /** 已经弹过一次*/
        int ALREADY_POP = 2;
        /** 关闭对话框*/
        int CANCEL_POP = 3;
        /** 功能按钮关闭*/
        int FUNCTION_CLOSE = 4;
        /** 首页自动弹窗结束*/
        int HOME_AUTO_DIALOG_LIST_END = 5;
        /** 连接中断后刷新数据*/
        int LINKAGE_INTERRUPT_REFRESH_DATA = 6;
    }

    @Retention(RetentionPolicy.SOURCE)
    @IntDef({Type.APP_UPDATE,Type.SYSTEM_NOTICE,Type.NEW_PLAYER_GIFT, Type.COUPON, Type.ANEW_DRAW_CARD, Type.ALL_MONEY_RETURN,
            Type.COUPON_NO_AUTO,Type.CARD_NO_AUTO,Type.WX_WELFARE_OFFICE_QRCODE,Type.HOME_AUTO_DIALOG_LIST,Type.LINKAGE_INTERRUPT,Type.RED_RAIN})
    public @interface Type {
        /** app更新*/
        int APP_UPDATE = 0;
        /** 系统公告*/
        int SYSTEM_NOTICE = 1;
        /** 新手礼盒*/
        int NEW_PLAYER_GIFT = 2;
        /** 优惠券*/
        int COUPON = 3;
        /** 重抽卡*/
        int ANEW_DRAW_CARD = 4;
        /** 全额返*/
        int ALL_MONEY_RETURN = 5;
        /** 非自动弹窗-优惠券*/
        int COUPON_NO_AUTO = 6;
        /** 非自动弹窗-卡片*/
        int CARD_NO_AUTO = 7;
        /** 微信福利官二维码*/
        int WX_WELFARE_OFFICE_QRCODE = 8;
        /** 首页自动弹窗*/
        int HOME_AUTO_DIALOG_LIST = 9;
        /** 连接中断*/
        int LINKAGE_INTERRUPT = 10;
        /** 红包雨*/
        int RED_RAIN = 11;
    }

    private int type;
    private int state;

    public HomeEvent(@Type int type, @State int state) {
        this.type = type;
        this.state = state;
    }

    public int getState() {
        return state;
    }

    public int getType() {
        return type;
    }
}
